(in-package :azala)

(defun substitute-variable (expression from to)
  (labels ((subst (exp)
	     (if (listp exp)
		 (simplify (mapcar #'subst exp))
		 (if (eql exp from) to exp))))
    (subst expression)))